{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [],
   "source": [
    "import numpy as np\n",
    "import pandas as pd\n",
    "import h5py\n",
    "import matplotlib.pyplot as plt\n",
    "import neurokit2 as nk"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>ECG_ID</th>\n",
       "      <th>Age</th>\n",
       "      <th>Age_class</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>A00002</td>\n",
       "      <td>32</td>\n",
       "      <td>2</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "   ECG_ID  Age  Age_class\n",
       "0  A00002   32          2"
      ]
     },
     "execution_count": 2,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "normal_ecg_age = pd.read_pickle('normal_ecg_age.pickle')\n",
    "normal_ecg_age.head(1)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 14,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "A00002\n"
     ]
    }
   ],
   "source": [
    "for id in normal_ecg_age['ECG_ID'][:1]:\n",
    "    print(id)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 30,
   "metadata": {},
   "outputs": [
    {
     "ename": "ValueError",
     "evalue": "NeuroKit error: the window cannot contain more data points than the time series. Decrease 'scale'.",
     "output_type": "error",
     "traceback": [
      "\u001b[1;31m---------------------------------------------------------------------------\u001b[0m",
      "\u001b[1;31mValueError\u001b[0m                                Traceback (most recent call last)",
      "Cell \u001b[1;32mIn[30], line 24\u001b[0m\n\u001b[0;32m     21\u001b[0m \u001b[39mfor\u001b[39;00m der \u001b[39min\u001b[39;00m \u001b[39mrange\u001b[39m(\u001b[39m12\u001b[39m):\n\u001b[0;32m     22\u001b[0m     \u001b[39m#try:\u001b[39;00m\n\u001b[0;32m     23\u001b[0m     signals,_ \u001b[39m=\u001b[39m nk\u001b[39m.\u001b[39mecg_process(f[\u001b[39m'\u001b[39m\u001b[39mecg\u001b[39m\u001b[39m'\u001b[39m][der][:\u001b[39m5000\u001b[39m], sampling_rate\u001b[39m=\u001b[39m\u001b[39m500\u001b[39m, method\u001b[39m=\u001b[39m\u001b[39m'\u001b[39m\u001b[39mneurokit\u001b[39m\u001b[39m'\u001b[39m)\n\u001b[1;32m---> 24\u001b[0m     analyse_df \u001b[39m=\u001b[39m nk\u001b[39m.\u001b[39;49mecg_analyze(signals, sampling_rate\u001b[39m=\u001b[39;49m\u001b[39m500\u001b[39;49m)\n\u001b[0;32m     25\u001b[0m     \u001b[39mprint\u001b[39m(analyse_df)\n\u001b[0;32m     26\u001b[0m     \u001b[39m#HRV_dataframe.loc[len(HRV_dataframe)] = nk.ecg_analyze(signals, sampling_rate=500)\u001b[39;00m\n\u001b[0;32m     27\u001b[0m     \n\u001b[0;32m     28\u001b[0m     \u001b[39m#except:\u001b[39;00m\n\u001b[0;32m     29\u001b[0m     \u001b[39m#    HRV_dataframe.loc[len(HRV_dataframe)] = np.NaN\u001b[39;00m\n\u001b[0;32m     30\u001b[0m     \u001b[39m#    continue      \u001b[39;00m\n",
      "File \u001b[1;32mc:\\Users\\YANIBIS\\ecg_biomarkers\\lib\\site-packages\\neurokit2\\ecg\\ecg_analyze.py:127\u001b[0m, in \u001b[0;36mecg_analyze\u001b[1;34m(data, sampling_rate, method)\u001b[0m\n\u001b[0;32m    125\u001b[0m     duration \u001b[39m=\u001b[39m \u001b[39mlen\u001b[39m(data) \u001b[39m/\u001b[39m sampling_rate\n\u001b[0;32m    126\u001b[0m \u001b[39mif\u001b[39;00m duration \u001b[39m>\u001b[39m\u001b[39m=\u001b[39m \u001b[39m10\u001b[39m:\n\u001b[1;32m--> 127\u001b[0m     features \u001b[39m=\u001b[39m ecg_intervalrelated(data, sampling_rate\u001b[39m=\u001b[39;49msampling_rate)\n\u001b[0;32m    128\u001b[0m \u001b[39melse\u001b[39;00m:\n\u001b[0;32m    129\u001b[0m     features \u001b[39m=\u001b[39m ecg_eventrelated(data)\n",
      "File \u001b[1;32mc:\\Users\\YANIBIS\\ecg_biomarkers\\lib\\site-packages\\neurokit2\\ecg\\ecg_intervalrelated.py:63\u001b[0m, in \u001b[0;36mecg_intervalrelated\u001b[1;34m(data, sampling_rate)\u001b[0m\n\u001b[0;32m     61\u001b[0m \u001b[39mif\u001b[39;00m \u001b[39mlen\u001b[39m(rate_cols) \u001b[39m==\u001b[39m \u001b[39m1\u001b[39m:\n\u001b[0;32m     62\u001b[0m     intervals\u001b[39m.\u001b[39mupdate(_ecg_intervalrelated_formatinput(data))\n\u001b[1;32m---> 63\u001b[0m     intervals\u001b[39m.\u001b[39mupdate(_ecg_intervalrelated_hrv(data, sampling_rate))\n\u001b[0;32m     64\u001b[0m \u001b[39melse\u001b[39;00m:\n\u001b[0;32m     65\u001b[0m     \u001b[39mraise\u001b[39;00m \u001b[39mValueError\u001b[39;00m(\n\u001b[0;32m     66\u001b[0m         \u001b[39m\"\u001b[39m\u001b[39mNeuroKit error: ecg_intervalrelated(): Wrong input,\u001b[39m\u001b[39m\"\u001b[39m\n\u001b[0;32m     67\u001b[0m         \u001b[39m\"\u001b[39m\u001b[39mwe couldn\u001b[39m\u001b[39m'\u001b[39m\u001b[39mt extract heart rate. Please make sure\u001b[39m\u001b[39m\"\u001b[39m\n\u001b[0;32m     68\u001b[0m         \u001b[39m\"\u001b[39m\u001b[39myour DataFrame contains an `ECG_Rate` column.\u001b[39m\u001b[39m\"\u001b[39m\n\u001b[0;32m     69\u001b[0m     )\n",
      "File \u001b[1;32mc:\\Users\\YANIBIS\\ecg_biomarkers\\lib\\site-packages\\neurokit2\\ecg\\ecg_intervalrelated.py:128\u001b[0m, in \u001b[0;36m_ecg_intervalrelated_hrv\u001b[1;34m(data, sampling_rate, output)\u001b[0m\n\u001b[0;32m    125\u001b[0m rpeaks \u001b[39m=\u001b[39m np\u001b[39m.\u001b[39mwhere(data[\u001b[39m\"\u001b[39m\u001b[39mECG_R_Peaks\u001b[39m\u001b[39m\"\u001b[39m]\u001b[39m.\u001b[39mvalues)[\u001b[39m0\u001b[39m]\n\u001b[0;32m    126\u001b[0m rpeaks \u001b[39m=\u001b[39m {\u001b[39m\"\u001b[39m\u001b[39mECG_R_Peaks\u001b[39m\u001b[39m\"\u001b[39m: rpeaks}\n\u001b[1;32m--> 128\u001b[0m results \u001b[39m=\u001b[39m hrv(rpeaks, sampling_rate\u001b[39m=\u001b[39;49msampling_rate)\n\u001b[0;32m    129\u001b[0m \u001b[39mfor\u001b[39;00m column \u001b[39min\u001b[39;00m results\u001b[39m.\u001b[39mcolumns:\n\u001b[0;32m    130\u001b[0m     output[column] \u001b[39m=\u001b[39m \u001b[39mfloat\u001b[39m(results[column])\n",
      "File \u001b[1;32mc:\\Users\\YANIBIS\\ecg_biomarkers\\lib\\site-packages\\neurokit2\\hrv\\hrv.py:107\u001b[0m, in \u001b[0;36mhrv\u001b[1;34m(peaks, sampling_rate, show, **kwargs)\u001b[0m\n\u001b[0;32m    105\u001b[0m out\u001b[39m.\u001b[39mappend(hrv_time(peaks, sampling_rate\u001b[39m=\u001b[39msampling_rate))\n\u001b[0;32m    106\u001b[0m out\u001b[39m.\u001b[39mappend(hrv_frequency(peaks, sampling_rate\u001b[39m=\u001b[39msampling_rate))\n\u001b[1;32m--> 107\u001b[0m out\u001b[39m.\u001b[39mappend(hrv_nonlinear(peaks, sampling_rate\u001b[39m=\u001b[39;49msampling_rate))\n\u001b[0;32m    109\u001b[0m \u001b[39m# Compute RSA if rsp data is available\u001b[39;00m\n\u001b[0;32m    110\u001b[0m \u001b[39mif\u001b[39;00m \u001b[39misinstance\u001b[39m(peaks, pd\u001b[39m.\u001b[39mDataFrame):\n",
      "File \u001b[1;32mc:\\Users\\YANIBIS\\ecg_biomarkers\\lib\\site-packages\\neurokit2\\hrv\\hrv_nonlinear.py:232\u001b[0m, in \u001b[0;36mhrv_nonlinear\u001b[1;34m(peaks, sampling_rate, show, **kwargs)\u001b[0m\n\u001b[0;32m    229\u001b[0m out \u001b[39m=\u001b[39m _hrv_nonlinear_poincare_hra(rri, rri_time\u001b[39m=\u001b[39mrri_time, rri_missing\u001b[39m=\u001b[39mrri_missing, out\u001b[39m=\u001b[39mout)\n\u001b[0;32m    231\u001b[0m \u001b[39m# DFA\u001b[39;00m\n\u001b[1;32m--> 232\u001b[0m out \u001b[39m=\u001b[39m _hrv_dfa(rri, out, \u001b[39m*\u001b[39;49m\u001b[39m*\u001b[39;49mkwargs)\n\u001b[0;32m    234\u001b[0m \u001b[39m# Complexity\u001b[39;00m\n\u001b[0;32m    235\u001b[0m tolerance \u001b[39m=\u001b[39m \u001b[39m0.2\u001b[39m \u001b[39m*\u001b[39m np\u001b[39m.\u001b[39mstd(rri, ddof\u001b[39m=\u001b[39m\u001b[39m1\u001b[39m)\n",
      "File \u001b[1;32mc:\\Users\\YANIBIS\\ecg_biomarkers\\lib\\site-packages\\neurokit2\\hrv\\hrv_nonlinear.py:465\u001b[0m, in \u001b[0;36m_hrv_dfa\u001b[1;34m(rri, out, n_windows, **kwargs)\u001b[0m\n\u001b[0;32m    463\u001b[0m short_window \u001b[39m=\u001b[39m np\u001b[39m.\u001b[39mlinspace(dfa_windows[\u001b[39m0\u001b[39m][\u001b[39m0\u001b[39m], dfa_windows[\u001b[39m0\u001b[39m][\u001b[39m1\u001b[39m], n_windows_short)\u001b[39m.\u001b[39mastype(\u001b[39mint\u001b[39m)\n\u001b[0;32m    464\u001b[0m \u001b[39m# For monofractal\u001b[39;00m\n\u001b[1;32m--> 465\u001b[0m out[\u001b[39m\"\u001b[39m\u001b[39mDFA_alpha1\u001b[39m\u001b[39m\"\u001b[39m], _ \u001b[39m=\u001b[39m fractal_dfa(rri, multifractal\u001b[39m=\u001b[39;49m\u001b[39mFalse\u001b[39;49;00m, scale\u001b[39m=\u001b[39;49mshort_window, \u001b[39m*\u001b[39;49m\u001b[39m*\u001b[39;49mkwargs)\n\u001b[0;32m    466\u001b[0m \u001b[39m# For multifractal\u001b[39;00m\n\u001b[0;32m    467\u001b[0m mdfa_alpha1, _ \u001b[39m=\u001b[39m fractal_dfa(rri, multifractal\u001b[39m=\u001b[39m\u001b[39mTrue\u001b[39;00m, q\u001b[39m=\u001b[39mnp\u001b[39m.\u001b[39marange(\u001b[39m-\u001b[39m\u001b[39m5\u001b[39m, \u001b[39m6\u001b[39m), scale\u001b[39m=\u001b[39mshort_window, \u001b[39m*\u001b[39m\u001b[39m*\u001b[39mkwargs)\n",
      "File \u001b[1;32mc:\\Users\\YANIBIS\\ecg_biomarkers\\lib\\site-packages\\neurokit2\\complexity\\fractal_dfa.py:212\u001b[0m, in \u001b[0;36mfractal_dfa\u001b[1;34m(signal, scale, overlap, integrate, order, multifractal, q, maxdfa, show, **kwargs)\u001b[0m\n\u001b[0;32m    207\u001b[0m     \u001b[39mraise\u001b[39;00m \u001b[39mValueError\u001b[39;00m(\n\u001b[0;32m    208\u001b[0m         \u001b[39m\"\u001b[39m\u001b[39mMultidimensional inputs (e.g., matrices or multichannel data) are not supported yet.\u001b[39m\u001b[39m\"\u001b[39m\n\u001b[0;32m    209\u001b[0m     )\n\u001b[0;32m    211\u001b[0m n \u001b[39m=\u001b[39m \u001b[39mlen\u001b[39m(signal)\n\u001b[1;32m--> 212\u001b[0m scale \u001b[39m=\u001b[39m _fractal_dfa_findscales(n, scale)\n\u001b[0;32m    214\u001b[0m \u001b[39m# Sanitize fractal power (cannot be close to 0)\u001b[39;00m\n\u001b[0;32m    215\u001b[0m q \u001b[39m=\u001b[39m _sanitize_q(q, multifractal\u001b[39m=\u001b[39mmultifractal)\n",
      "File \u001b[1;32mc:\\Users\\YANIBIS\\ecg_biomarkers\\lib\\site-packages\\neurokit2\\complexity\\fractal_dfa.py:332\u001b[0m, in \u001b[0;36m_fractal_dfa_findscales\u001b[1;34m(n, scale)\u001b[0m\n\u001b[0;32m    328\u001b[0m     \u001b[39mraise\u001b[39;00m \u001b[39mValueError\u001b[39;00m(\n\u001b[0;32m    329\u001b[0m         \u001b[39m\"\u001b[39m\u001b[39mNeuroKit error: there must be at least 2 data points in each window. Decrease \u001b[39m\u001b[39m'\u001b[39m\u001b[39mscale\u001b[39m\u001b[39m'\u001b[39m\u001b[39m.\u001b[39m\u001b[39m\"\u001b[39m\n\u001b[0;32m    330\u001b[0m     )\n\u001b[0;32m    331\u001b[0m \u001b[39mif\u001b[39;00m np\u001b[39m.\u001b[39mmax(scale) \u001b[39m>\u001b[39m\u001b[39m=\u001b[39m n:\n\u001b[1;32m--> 332\u001b[0m     \u001b[39mraise\u001b[39;00m \u001b[39mValueError\u001b[39;00m(\n\u001b[0;32m    333\u001b[0m         \u001b[39m\"\u001b[39m\u001b[39mNeuroKit error: the window cannot contain more data points than the time series. Decrease \u001b[39m\u001b[39m'\u001b[39m\u001b[39mscale\u001b[39m\u001b[39m'\u001b[39m\u001b[39m.\u001b[39m\u001b[39m\"\u001b[39m\n\u001b[0;32m    334\u001b[0m     )\n\u001b[0;32m    336\u001b[0m \u001b[39mreturn\u001b[39;00m scale\n",
      "\u001b[1;31mValueError\u001b[0m: NeuroKit error: the window cannot contain more data points than the time series. Decrease 'scale'."
     ]
    }
   ],
   "source": [
    "HRV_dataframe = pd.DataFrame(columns=['ECG_Rate_Mean', 'HRV_MeanNN', 'HRV_SDNN', 'HRV_SDANN1', 'HRV_SDNNI1',\n",
    "       'HRV_SDANN2', 'HRV_SDNNI2', 'HRV_SDANN5', 'HRV_SDNNI5', 'HRV_RMSSD',\n",
    "       'HRV_SDSD', 'HRV_CVNN', 'HRV_CVSD', 'HRV_MedianNN', 'HRV_MadNN',\n",
    "       'HRV_MCVNN', 'HRV_IQRNN', 'HRV_Prc20NN', 'HRV_Prc80NN', 'HRV_pNN50',\n",
    "       'HRV_pNN20', 'HRV_MinNN', 'HRV_MaxNN', 'HRV_HTI', 'HRV_TINN', 'HRV_ULF',\n",
    "       'HRV_VLF', 'HRV_LF', 'HRV_HF', 'HRV_VHF', 'HRV_LFHF', 'HRV_LFn',\n",
    "       'HRV_HFn', 'HRV_LnHF', 'HRV_SD1', 'HRV_SD2', 'HRV_SD1SD2', 'HRV_S',\n",
    "       'HRV_CSI', 'HRV_CVI', 'HRV_CSI_Modified', 'HRV_PIP', 'HRV_IALS',\n",
    "       'HRV_PSS', 'HRV_PAS', 'HRV_GI', 'HRV_SI', 'HRV_AI', 'HRV_PI', 'HRV_C1d',\n",
    "       'HRV_C1a', 'HRV_SD1d', 'HRV_SD1a', 'HRV_C2d', 'HRV_C2a', 'HRV_SD2d',\n",
    "       'HRV_SD2a', 'HRV_Cd', 'HRV_Ca', 'HRV_SDNNd', 'HRV_SDNNa',\n",
    "       'HRV_DFA_alpha1', 'HRV_MFDFA_alpha1_Width', 'HRV_MFDFA_alpha1_Peak',\n",
    "       'HRV_MFDFA_alpha1_Mean', 'HRV_MFDFA_alpha1_Max',\n",
    "       'HRV_MFDFA_alpha1_Delta', 'HRV_MFDFA_alpha1_Asymmetry',\n",
    "       'HRV_MFDFA_alpha1_Fluctuation', 'HRV_MFDFA_alpha1_Increment',\n",
    "       'HRV_ApEn', 'HRV_SampEn', 'HRV_ShanEn', 'HRV_FuzzyEn', 'HRV_MSEn',\n",
    "       'HRV_CMSEn', 'HRV_RCMSEn', 'HRV_CD', 'HRV_HFD', 'HRV_KFD', 'HRV_LZC'])\n",
    "\n",
    "for id in normal_ecg_age['ECG_ID'][:1]:\n",
    "    with h5py.File(f'E:/1-DENIS/Biomarkers/SPH dataset/records/{id}.h5', 'r') as f:\n",
    "        for der in range(12):\n",
    "            #try:\n",
    "            signals,_ = nk.ecg_process(f['ecg'][der][:5000], sampling_rate=500, method='neurokit')\n",
    "            analyse_df = nk.ecg_analyze(signals, sampling_rate=500)\n",
    "            print(analyse_df)\n",
    "            #HRV_dataframe.loc[len(HRV_dataframe)] = nk.ecg_analyze(signals, sampling_rate=500)\n",
    "            \n",
    "            #except:\n",
    "            #    HRV_dataframe.loc[len(HRV_dataframe)] = np.NaN\n",
    "            #    continue      \n",
    "        \n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 59,
   "metadata": {},
   "outputs": [],
   "source": [
    "id = 'A00006'\n",
    "with h5py.File(f'E:/1-DENIS/Biomarkers/SPH dataset/records/{id}.h5', 'r') as f:\n",
    "    signal = f['ecg'][0]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 60,
   "metadata": {},
   "outputs": [],
   "source": [
    "signals,_ = nk.ecg_process(signal, sampling_rate=500, method='neurokit')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 61,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>ECG_Raw</th>\n",
       "      <th>ECG_Clean</th>\n",
       "      <th>ECG_Rate</th>\n",
       "      <th>ECG_Quality</th>\n",
       "      <th>ECG_R_Peaks</th>\n",
       "      <th>ECG_P_Peaks</th>\n",
       "      <th>ECG_P_Onsets</th>\n",
       "      <th>ECG_P_Offsets</th>\n",
       "      <th>ECG_Q_Peaks</th>\n",
       "      <th>ECG_R_Onsets</th>\n",
       "      <th>ECG_R_Offsets</th>\n",
       "      <th>ECG_S_Peaks</th>\n",
       "      <th>ECG_T_Peaks</th>\n",
       "      <th>ECG_T_Onsets</th>\n",
       "      <th>ECG_T_Offsets</th>\n",
       "      <th>ECG_Phase_Atrial</th>\n",
       "      <th>ECG_Phase_Completion_Atrial</th>\n",
       "      <th>ECG_Phase_Ventricular</th>\n",
       "      <th>ECG_Phase_Completion_Ventricular</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>-0.044006</td>\n",
       "      <td>-0.010399</td>\n",
       "      <td>62.543433</td>\n",
       "      <td>0.939596</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>0.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>0.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>-0.052002</td>\n",
       "      <td>-0.010408</td>\n",
       "      <td>62.543433</td>\n",
       "      <td>0.939596</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>0.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>0.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>-0.045593</td>\n",
       "      <td>-0.010130</td>\n",
       "      <td>62.543433</td>\n",
       "      <td>0.939596</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>0.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>0.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>-0.039215</td>\n",
       "      <td>-0.009732</td>\n",
       "      <td>62.543433</td>\n",
       "      <td>0.939596</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>0.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>0.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>-0.037598</td>\n",
       "      <td>-0.009390</td>\n",
       "      <td>62.543433</td>\n",
       "      <td>0.939596</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>0.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>0.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4995</th>\n",
       "      <td>-0.007198</td>\n",
       "      <td>0.013690</td>\n",
       "      <td>62.761506</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>0.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>0.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4996</th>\n",
       "      <td>-0.016006</td>\n",
       "      <td>0.012721</td>\n",
       "      <td>62.761506</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>0.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>0.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4997</th>\n",
       "      <td>0.000800</td>\n",
       "      <td>0.011748</td>\n",
       "      <td>62.761506</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>0.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>0.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4998</th>\n",
       "      <td>-0.001600</td>\n",
       "      <td>0.010353</td>\n",
       "      <td>62.761506</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>0.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>0.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4999</th>\n",
       "      <td>-0.016800</td>\n",
       "      <td>0.008600</td>\n",
       "      <td>62.761506</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>0.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>0.0</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>5000 rows × 19 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "       ECG_Raw  ECG_Clean   ECG_Rate  ECG_Quality  ECG_R_Peaks  ECG_P_Peaks  \\\n",
       "0    -0.044006  -0.010399  62.543433     0.939596            0            0   \n",
       "1    -0.052002  -0.010408  62.543433     0.939596            0            0   \n",
       "2    -0.045593  -0.010130  62.543433     0.939596            0            0   \n",
       "3    -0.039215  -0.009732  62.543433     0.939596            0            0   \n",
       "4    -0.037598  -0.009390  62.543433     0.939596            0            0   \n",
       "...        ...        ...        ...          ...          ...          ...   \n",
       "4995 -0.007198   0.013690  62.761506     0.000000            0            0   \n",
       "4996 -0.016006   0.012721  62.761506     0.000000            0            0   \n",
       "4997  0.000800   0.011748  62.761506     0.000000            0            0   \n",
       "4998 -0.001600   0.010353  62.761506     0.000000            0            0   \n",
       "4999 -0.016800   0.008600  62.761506     0.000000            0            0   \n",
       "\n",
       "      ECG_P_Onsets  ECG_P_Offsets  ECG_Q_Peaks  ECG_R_Onsets  ECG_R_Offsets  \\\n",
       "0                0              0            0             0              0   \n",
       "1                0              0            0             0              0   \n",
       "2                0              0            0             0              0   \n",
       "3                0              0            0             0              0   \n",
       "4                0              0            0             0              0   \n",
       "...            ...            ...          ...           ...            ...   \n",
       "4995             0              0            0             0              0   \n",
       "4996             0              0            0             0              0   \n",
       "4997             0              0            0             0              0   \n",
       "4998             0              0            0             0              0   \n",
       "4999             0              0            0             0              0   \n",
       "\n",
       "      ECG_S_Peaks  ECG_T_Peaks  ECG_T_Onsets  ECG_T_Offsets  ECG_Phase_Atrial  \\\n",
       "0               0            0             0              0               NaN   \n",
       "1               0            0             0              0               NaN   \n",
       "2               0            0             0              0               NaN   \n",
       "3               0            0             0              0               NaN   \n",
       "4               0            0             0              0               NaN   \n",
       "...           ...          ...           ...            ...               ...   \n",
       "4995            0            0             0              0               NaN   \n",
       "4996            0            0             0              0               NaN   \n",
       "4997            0            0             0              0               NaN   \n",
       "4998            0            0             0              0               NaN   \n",
       "4999            0            0             0              0               NaN   \n",
       "\n",
       "      ECG_Phase_Completion_Atrial  ECG_Phase_Ventricular  \\\n",
       "0                             0.0                    NaN   \n",
       "1                             0.0                    NaN   \n",
       "2                             0.0                    NaN   \n",
       "3                             0.0                    NaN   \n",
       "4                             0.0                    NaN   \n",
       "...                           ...                    ...   \n",
       "4995                          0.0                    NaN   \n",
       "4996                          0.0                    NaN   \n",
       "4997                          0.0                    NaN   \n",
       "4998                          0.0                    NaN   \n",
       "4999                          0.0                    NaN   \n",
       "\n",
       "      ECG_Phase_Completion_Ventricular  \n",
       "0                                  0.0  \n",
       "1                                  0.0  \n",
       "2                                  0.0  \n",
       "3                                  0.0  \n",
       "4                                  0.0  \n",
       "...                                ...  \n",
       "4995                               0.0  \n",
       "4996                               0.0  \n",
       "4997                               0.0  \n",
       "4998                               0.0  \n",
       "4999                               0.0  \n",
       "\n",
       "[5000 rows x 19 columns]"
      ]
     },
     "execution_count": 61,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "signals"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 62,
   "metadata": {},
   "outputs": [
    {
     "ename": "ValueError",
     "evalue": "NeuroKit error: the window cannot contain more data points than the time series. Decrease 'scale'.",
     "output_type": "error",
     "traceback": [
      "\u001b[1;31m---------------------------------------------------------------------------\u001b[0m",
      "\u001b[1;31mValueError\u001b[0m                                Traceback (most recent call last)",
      "Cell \u001b[1;32mIn[62], line 1\u001b[0m\n\u001b[1;32m----> 1\u001b[0m analyze_df \u001b[39m=\u001b[39m nk\u001b[39m.\u001b[39;49mecg_analyze(signals, sampling_rate\u001b[39m=\u001b[39;49m\u001b[39m500\u001b[39;49m)\n",
      "File \u001b[1;32mc:\\Users\\YANIBIS\\ecg_biomarkers\\lib\\site-packages\\neurokit2\\ecg\\ecg_analyze.py:127\u001b[0m, in \u001b[0;36mecg_analyze\u001b[1;34m(data, sampling_rate, method)\u001b[0m\n\u001b[0;32m    125\u001b[0m     duration \u001b[39m=\u001b[39m \u001b[39mlen\u001b[39m(data) \u001b[39m/\u001b[39m sampling_rate\n\u001b[0;32m    126\u001b[0m \u001b[39mif\u001b[39;00m duration \u001b[39m>\u001b[39m\u001b[39m=\u001b[39m \u001b[39m10\u001b[39m:\n\u001b[1;32m--> 127\u001b[0m     features \u001b[39m=\u001b[39m ecg_intervalrelated(data, sampling_rate\u001b[39m=\u001b[39;49msampling_rate)\n\u001b[0;32m    128\u001b[0m \u001b[39melse\u001b[39;00m:\n\u001b[0;32m    129\u001b[0m     features \u001b[39m=\u001b[39m ecg_eventrelated(data)\n",
      "File \u001b[1;32mc:\\Users\\YANIBIS\\ecg_biomarkers\\lib\\site-packages\\neurokit2\\ecg\\ecg_intervalrelated.py:63\u001b[0m, in \u001b[0;36mecg_intervalrelated\u001b[1;34m(data, sampling_rate)\u001b[0m\n\u001b[0;32m     61\u001b[0m \u001b[39mif\u001b[39;00m \u001b[39mlen\u001b[39m(rate_cols) \u001b[39m==\u001b[39m \u001b[39m1\u001b[39m:\n\u001b[0;32m     62\u001b[0m     intervals\u001b[39m.\u001b[39mupdate(_ecg_intervalrelated_formatinput(data))\n\u001b[1;32m---> 63\u001b[0m     intervals\u001b[39m.\u001b[39mupdate(_ecg_intervalrelated_hrv(data, sampling_rate))\n\u001b[0;32m     64\u001b[0m \u001b[39melse\u001b[39;00m:\n\u001b[0;32m     65\u001b[0m     \u001b[39mraise\u001b[39;00m \u001b[39mValueError\u001b[39;00m(\n\u001b[0;32m     66\u001b[0m         \u001b[39m\"\u001b[39m\u001b[39mNeuroKit error: ecg_intervalrelated(): Wrong input,\u001b[39m\u001b[39m\"\u001b[39m\n\u001b[0;32m     67\u001b[0m         \u001b[39m\"\u001b[39m\u001b[39mwe couldn\u001b[39m\u001b[39m'\u001b[39m\u001b[39mt extract heart rate. Please make sure\u001b[39m\u001b[39m\"\u001b[39m\n\u001b[0;32m     68\u001b[0m         \u001b[39m\"\u001b[39m\u001b[39myour DataFrame contains an `ECG_Rate` column.\u001b[39m\u001b[39m\"\u001b[39m\n\u001b[0;32m     69\u001b[0m     )\n",
      "File \u001b[1;32mc:\\Users\\YANIBIS\\ecg_biomarkers\\lib\\site-packages\\neurokit2\\ecg\\ecg_intervalrelated.py:128\u001b[0m, in \u001b[0;36m_ecg_intervalrelated_hrv\u001b[1;34m(data, sampling_rate, output)\u001b[0m\n\u001b[0;32m    125\u001b[0m rpeaks \u001b[39m=\u001b[39m np\u001b[39m.\u001b[39mwhere(data[\u001b[39m\"\u001b[39m\u001b[39mECG_R_Peaks\u001b[39m\u001b[39m\"\u001b[39m]\u001b[39m.\u001b[39mvalues)[\u001b[39m0\u001b[39m]\n\u001b[0;32m    126\u001b[0m rpeaks \u001b[39m=\u001b[39m {\u001b[39m\"\u001b[39m\u001b[39mECG_R_Peaks\u001b[39m\u001b[39m\"\u001b[39m: rpeaks}\n\u001b[1;32m--> 128\u001b[0m results \u001b[39m=\u001b[39m hrv(rpeaks, sampling_rate\u001b[39m=\u001b[39;49msampling_rate)\n\u001b[0;32m    129\u001b[0m \u001b[39mfor\u001b[39;00m column \u001b[39min\u001b[39;00m results\u001b[39m.\u001b[39mcolumns:\n\u001b[0;32m    130\u001b[0m     output[column] \u001b[39m=\u001b[39m \u001b[39mfloat\u001b[39m(results[column])\n",
      "File \u001b[1;32mc:\\Users\\YANIBIS\\ecg_biomarkers\\lib\\site-packages\\neurokit2\\hrv\\hrv.py:107\u001b[0m, in \u001b[0;36mhrv\u001b[1;34m(peaks, sampling_rate, show, **kwargs)\u001b[0m\n\u001b[0;32m    105\u001b[0m out\u001b[39m.\u001b[39mappend(hrv_time(peaks, sampling_rate\u001b[39m=\u001b[39msampling_rate))\n\u001b[0;32m    106\u001b[0m out\u001b[39m.\u001b[39mappend(hrv_frequency(peaks, sampling_rate\u001b[39m=\u001b[39msampling_rate))\n\u001b[1;32m--> 107\u001b[0m out\u001b[39m.\u001b[39mappend(hrv_nonlinear(peaks, sampling_rate\u001b[39m=\u001b[39;49msampling_rate))\n\u001b[0;32m    109\u001b[0m \u001b[39m# Compute RSA if rsp data is available\u001b[39;00m\n\u001b[0;32m    110\u001b[0m \u001b[39mif\u001b[39;00m \u001b[39misinstance\u001b[39m(peaks, pd\u001b[39m.\u001b[39mDataFrame):\n",
      "File \u001b[1;32mc:\\Users\\YANIBIS\\ecg_biomarkers\\lib\\site-packages\\neurokit2\\hrv\\hrv_nonlinear.py:232\u001b[0m, in \u001b[0;36mhrv_nonlinear\u001b[1;34m(peaks, sampling_rate, show, **kwargs)\u001b[0m\n\u001b[0;32m    229\u001b[0m out \u001b[39m=\u001b[39m _hrv_nonlinear_poincare_hra(rri, rri_time\u001b[39m=\u001b[39mrri_time, rri_missing\u001b[39m=\u001b[39mrri_missing, out\u001b[39m=\u001b[39mout)\n\u001b[0;32m    231\u001b[0m \u001b[39m# DFA\u001b[39;00m\n\u001b[1;32m--> 232\u001b[0m out \u001b[39m=\u001b[39m _hrv_dfa(rri, out, \u001b[39m*\u001b[39;49m\u001b[39m*\u001b[39;49mkwargs)\n\u001b[0;32m    234\u001b[0m \u001b[39m# Complexity\u001b[39;00m\n\u001b[0;32m    235\u001b[0m tolerance \u001b[39m=\u001b[39m \u001b[39m0.2\u001b[39m \u001b[39m*\u001b[39m np\u001b[39m.\u001b[39mstd(rri, ddof\u001b[39m=\u001b[39m\u001b[39m1\u001b[39m)\n",
      "File \u001b[1;32mc:\\Users\\YANIBIS\\ecg_biomarkers\\lib\\site-packages\\neurokit2\\hrv\\hrv_nonlinear.py:465\u001b[0m, in \u001b[0;36m_hrv_dfa\u001b[1;34m(rri, out, n_windows, **kwargs)\u001b[0m\n\u001b[0;32m    463\u001b[0m short_window \u001b[39m=\u001b[39m np\u001b[39m.\u001b[39mlinspace(dfa_windows[\u001b[39m0\u001b[39m][\u001b[39m0\u001b[39m], dfa_windows[\u001b[39m0\u001b[39m][\u001b[39m1\u001b[39m], n_windows_short)\u001b[39m.\u001b[39mastype(\u001b[39mint\u001b[39m)\n\u001b[0;32m    464\u001b[0m \u001b[39m# For monofractal\u001b[39;00m\n\u001b[1;32m--> 465\u001b[0m out[\u001b[39m\"\u001b[39m\u001b[39mDFA_alpha1\u001b[39m\u001b[39m\"\u001b[39m], _ \u001b[39m=\u001b[39m fractal_dfa(rri, multifractal\u001b[39m=\u001b[39;49m\u001b[39mFalse\u001b[39;49;00m, scale\u001b[39m=\u001b[39;49mshort_window, \u001b[39m*\u001b[39;49m\u001b[39m*\u001b[39;49mkwargs)\n\u001b[0;32m    466\u001b[0m \u001b[39m# For multifractal\u001b[39;00m\n\u001b[0;32m    467\u001b[0m mdfa_alpha1, _ \u001b[39m=\u001b[39m fractal_dfa(rri, multifractal\u001b[39m=\u001b[39m\u001b[39mTrue\u001b[39;00m, q\u001b[39m=\u001b[39mnp\u001b[39m.\u001b[39marange(\u001b[39m-\u001b[39m\u001b[39m5\u001b[39m, \u001b[39m6\u001b[39m), scale\u001b[39m=\u001b[39mshort_window, \u001b[39m*\u001b[39m\u001b[39m*\u001b[39mkwargs)\n",
      "File \u001b[1;32mc:\\Users\\YANIBIS\\ecg_biomarkers\\lib\\site-packages\\neurokit2\\complexity\\fractal_dfa.py:212\u001b[0m, in \u001b[0;36mfractal_dfa\u001b[1;34m(signal, scale, overlap, integrate, order, multifractal, q, maxdfa, show, **kwargs)\u001b[0m\n\u001b[0;32m    207\u001b[0m     \u001b[39mraise\u001b[39;00m \u001b[39mValueError\u001b[39;00m(\n\u001b[0;32m    208\u001b[0m         \u001b[39m\"\u001b[39m\u001b[39mMultidimensional inputs (e.g., matrices or multichannel data) are not supported yet.\u001b[39m\u001b[39m\"\u001b[39m\n\u001b[0;32m    209\u001b[0m     )\n\u001b[0;32m    211\u001b[0m n \u001b[39m=\u001b[39m \u001b[39mlen\u001b[39m(signal)\n\u001b[1;32m--> 212\u001b[0m scale \u001b[39m=\u001b[39m _fractal_dfa_findscales(n, scale)\n\u001b[0;32m    214\u001b[0m \u001b[39m# Sanitize fractal power (cannot be close to 0)\u001b[39;00m\n\u001b[0;32m    215\u001b[0m q \u001b[39m=\u001b[39m _sanitize_q(q, multifractal\u001b[39m=\u001b[39mmultifractal)\n",
      "File \u001b[1;32mc:\\Users\\YANIBIS\\ecg_biomarkers\\lib\\site-packages\\neurokit2\\complexity\\fractal_dfa.py:332\u001b[0m, in \u001b[0;36m_fractal_dfa_findscales\u001b[1;34m(n, scale)\u001b[0m\n\u001b[0;32m    328\u001b[0m     \u001b[39mraise\u001b[39;00m \u001b[39mValueError\u001b[39;00m(\n\u001b[0;32m    329\u001b[0m         \u001b[39m\"\u001b[39m\u001b[39mNeuroKit error: there must be at least 2 data points in each window. Decrease \u001b[39m\u001b[39m'\u001b[39m\u001b[39mscale\u001b[39m\u001b[39m'\u001b[39m\u001b[39m.\u001b[39m\u001b[39m\"\u001b[39m\n\u001b[0;32m    330\u001b[0m     )\n\u001b[0;32m    331\u001b[0m \u001b[39mif\u001b[39;00m np\u001b[39m.\u001b[39mmax(scale) \u001b[39m>\u001b[39m\u001b[39m=\u001b[39m n:\n\u001b[1;32m--> 332\u001b[0m     \u001b[39mraise\u001b[39;00m \u001b[39mValueError\u001b[39;00m(\n\u001b[0;32m    333\u001b[0m         \u001b[39m\"\u001b[39m\u001b[39mNeuroKit error: the window cannot contain more data points than the time series. Decrease \u001b[39m\u001b[39m'\u001b[39m\u001b[39mscale\u001b[39m\u001b[39m'\u001b[39m\u001b[39m.\u001b[39m\u001b[39m\"\u001b[39m\n\u001b[0;32m    334\u001b[0m     )\n\u001b[0;32m    336\u001b[0m \u001b[39mreturn\u001b[39;00m scale\n",
      "\u001b[1;31mValueError\u001b[0m: NeuroKit error: the window cannot contain more data points than the time series. Decrease 'scale'."
     ]
    }
   ],
   "source": [
    "analyze_df = nk.ecg_analyze(signals, sampling_rate=500)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 22,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "Index(['ECG_Rate_Mean', 'HRV_MeanNN', 'HRV_SDNN', 'HRV_SDANN1', 'HRV_SDNNI1',\n",
       "       'HRV_SDANN2', 'HRV_SDNNI2', 'HRV_SDANN5', 'HRV_SDNNI5', 'HRV_RMSSD',\n",
       "       'HRV_SDSD', 'HRV_CVNN', 'HRV_CVSD', 'HRV_MedianNN', 'HRV_MadNN',\n",
       "       'HRV_MCVNN', 'HRV_IQRNN', 'HRV_Prc20NN', 'HRV_Prc80NN', 'HRV_pNN50',\n",
       "       'HRV_pNN20', 'HRV_MinNN', 'HRV_MaxNN', 'HRV_HTI', 'HRV_TINN', 'HRV_ULF',\n",
       "       'HRV_VLF', 'HRV_LF', 'HRV_HF', 'HRV_VHF', 'HRV_LFHF', 'HRV_LFn',\n",
       "       'HRV_HFn', 'HRV_LnHF', 'HRV_SD1', 'HRV_SD2', 'HRV_SD1SD2', 'HRV_S',\n",
       "       'HRV_CSI', 'HRV_CVI', 'HRV_CSI_Modified', 'HRV_PIP', 'HRV_IALS',\n",
       "       'HRV_PSS', 'HRV_PAS', 'HRV_GI', 'HRV_SI', 'HRV_AI', 'HRV_PI', 'HRV_C1d',\n",
       "       'HRV_C1a', 'HRV_SD1d', 'HRV_SD1a', 'HRV_C2d', 'HRV_C2a', 'HRV_SD2d',\n",
       "       'HRV_SD2a', 'HRV_Cd', 'HRV_Ca', 'HRV_SDNNd', 'HRV_SDNNa',\n",
       "       'HRV_DFA_alpha1', 'HRV_MFDFA_alpha1_Width', 'HRV_MFDFA_alpha1_Peak',\n",
       "       'HRV_MFDFA_alpha1_Mean', 'HRV_MFDFA_alpha1_Max',\n",
       "       'HRV_MFDFA_alpha1_Delta', 'HRV_MFDFA_alpha1_Asymmetry',\n",
       "       'HRV_MFDFA_alpha1_Fluctuation', 'HRV_MFDFA_alpha1_Increment',\n",
       "       'HRV_ApEn', 'HRV_SampEn', 'HRV_ShanEn', 'HRV_FuzzyEn', 'HRV_MSEn',\n",
       "       'HRV_CMSEn', 'HRV_RCMSEn', 'HRV_CD', 'HRV_HFD', 'HRV_KFD', 'HRV_LZC'],\n",
       "      dtype='object')"
      ]
     },
     "execution_count": 22,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "analyze_df.columns"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3.8.5 ('ecg_biomarkers': venv)",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.8.5"
  },
  "orig_nbformat": 4,
  "vscode": {
   "interpreter": {
    "hash": "d39f5264c2f26cb0964d5a98dbbf3a9d2bc7301339817434e4f0ffa82f5f047f"
   }
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
